<!-- INCLUDE sv_overall_header.html -->

<!-- IF  S_USE_HTML5_CANVAS -->	
<script src="{T_TEMPLATE_PATH}/RGraph/RGraph.common.core.js" ></script>
<script src="{T_TEMPLATE_PATH}/RGraph/RGraph.common.dynamic.js" ></script>
<script src="{T_TEMPLATE_PATH}/RGraph/RGraph.tooltips.js" ></script>
<script src="{T_TEMPLATE_PATH}/RGraph/RGraph.line.js" ></script>
<!-- ENDIF -->


<!-- IF IN_FB_IFRAME -->
	<script type="text/javascript" src="../ofc/js/json/json2.js"></script>
	<script type="text/javascript" src="../ofc/js/swfobject.js"></script>
	<script type="text/javascript">
	
	swfobject.embedSWF("../ofc/open-flash-chart.swf", "my_chart", "680", "350", "9.0.0", "expressInstall.swf",  {"get-data":"get_data_1"} );
	</script>
<!-- ELSE -->
	<script type="text/javascript" src="ofc/js/json/json2.js"></script>
	<script type="text/javascript" src="ofc/js/swfobject.js"></script>
	<script type="text/javascript">
	
	swfobject.embedSWF("ofc/open-flash-chart.swf", "my_chart", "950", "550", "9.0.0", "expressInstall.swf",  {"get-data":"get_data_1"} );
	</script>
<!-- ENDIF -->
<script >

function follow(add) 
{	
	var strURL = '{S_FOLLOW_ACTION}';
	var xmlHttpReq = false;
    
    var self = this;
    
    
    
    // Mozilla/Safari
    if (window.XMLHttpRequest) 
	{
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) 
	{
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() 
	{
        if (self.xmlHttpReq.readyState == 4)
		{
			// get result back.
			var response = self.xmlHttpReq.responseText;
			
			num = parseInt(response, 10);

			// update follower number & text.
			update_follow_text();
			update_follower_num(num);
        }
    }
    self.xmlHttpReq.send(getquerystring(add));
}

function getquerystring(add) 
{
    var	followee_user_id = {S_QUERY_USER_ID};
	
    if (add == true)
    {
    	qstr = 'mode=add&followee_user_id=' + escape(followee_user_id);  // NOTE: no '?' before querystring
    	return qstr;
	}
	else
	{
		qstr = 'mode=remove&followee_user_id=' + escape(followee_user_id);  // NOTE: no '?' before querystring
    	return qstr;
	}
}

function update_follow_text(){
    document.getElementById("follow_text").innerHTML = '';
}

function update_follower_num(num)
{
	if (num != 0)
	{
		document.getElementById("follower_num").innerHTML = ' (' + num + ' {L_SV_FOLLOWER_NUM})';
	}
	else
	{
		document.getElementById("follower_num").innerHTML = ' ';
	}
}
</script>

<script >
function ofc_ready()
{
    //alert('ofc_ready');
}

function get_data_1()
{
    //alert( 'reading data' );
    return JSON.stringify(data);
}

function findSWF(movieName) {
  if (navigator.appName.indexOf("Microsoft")!= -1) {
    return window[movieName];
  } else {
    return document[movieName];
  }
}
    
var data = {JASON_STRING};

</script>


<script type="text/javascript" language="JavaScript">
	    function ShowContent(d) 
	    {
			document.getElementById(d).style.display = "block";
		}
		function HideContent(d) 
	    {
			document.getElementById(d).style.display = "none";
		}
		function ShowShareOption()
		{
			ShowContent('share_div');			
			document.getElementById('share_url').focus();
		}			
</script>
	    




<div class="panel" > 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>
		<!-- IF USER_FB_ID != 0 -->
		<img src="http://graph.facebook.com/{USER_FB_ID}/picture" width=32 height=32>
		<!-- ENDIF -->
		{U_QUERY_USERNAME}  
		
	
	
		
	</h2> 	
</div>

<table border="0" cellpadding="5" cellspacing="5">
	<tr>
		<td>
			<a href="{U_PM}" target="_blank"> <p> {L_SV_PM_TO} {U_QUERY_USERNAME} </p> </a>
		</td>	
	</tr>	
	
	<tr>
		<td>
			<span id="follower_num"><!-- IF S_FOLLOWER_NUM ne 0 --><p>{S_FOLLOWER_NUM} {L_SV_FOLLOWER_NUM}</p> <!-- ENDIF --></span> 
			<span id="follow_text"> 
			<!-- IF S_USER_LOGGED_IN and S_USER_ID ne S_QUERY_USER_ID-->
				<!-- IF S_FOLLOWING --> <a href="#" onclick="follow(false);"> <p> {L_SV_CANCEL_FOLLOWER} </p></a> 
				<!-- ELSE --> <a href="#" onclick="follow(true);"> <p> {L_SV_FOLLOW} {U_QUERY_USERNAME} </p></a> 
				<!-- ENDIF --> 
			<!-- ENDIF --> 
			</span> 			
		</td>	
	</tr>	
	
	<tr>
		<td>
					
			<a href="javascript:ShowShareOption()">	<p> {L_SV_SHARE} </p> </a>	
		
			<div id="share_div" style="display:none;">	
			<a href="
				https://www.facebook.com/dialog/feed?
		  		app_id={S_FB_APP_ID}&
		  		link={BOARD_URL}query_user.php?mode=query_user%26user_id={S_QUERY_USER_ID}&
		  		picture={BOARD_URL}{T_IMAGES_PATH}logo.jpg&
		  		name={U_QUERY_USERNAME} - {SITENAME} &
		  		caption={L_SV_ABOUT_CONTENT}&
		  		description=
		  		<!-- IF SHOW_1_MONTH_ROI -->	
				{U_QUERY_USERNAME}%20-%20{L_SV_ROI_LAST_1_MONTH}:{S_ROI_1_MONTH}%25%2C%20
				<!-- ENDIF -->	
				
				<!-- IF SHOW_3_MONTH_ROI -->
				{L_SV_ROI_LAST_3_MONTH}:{S_ROI_3_MONTH}	%25%2C%20
				<!-- ENDIF -->	
				
				<!-- IF SHOW_6_MONTH_ROI -->	
				{L_SV_ROI_LAST_6_MONTH}:{S_ROI_6_MONTH}%25%2C%20
				<!-- ENDIF -->	
				
				<!-- IF SHOW_12_MONTH_ROI -->
				{L_SV_ROI_LAST_12_MONTH}:{S_ROI_12_MONTH}%25%2C%20
				<!-- ENDIF -->			
		  		
		  		&
		  		redirect_uri={BOARD_URL}fb/redirect.php?mode=self_close
		  		" 
		  		target="_blank">
		  	{L_SV_SHARE_ON_FB}
			</a>
		 		<BR>
		 		<BR>
			<label for="username">{L_SV_SHARE_URL}  </label>&nbsp;
			<input type="text" name="share_url" id="share_url" size="10" class="inputbox" title="{L_SV_SHARE_URL_TIP}" 
					value="{BOARD_URL}query_user.php?mode=query_user&user_id={S_QUERY_USER_ID}"
			/>
				<BR>
				<BR>
			</div>
			
		</td>	
	</tr>	
	
</table>


<!-- IF S_SHOW_BELIEF -->
<table border="0" cellpadding="5" cellspacing="5">
	<tr>
		<td><p>{L_SV_INVESTMENT_BELIEF}</p></td> 
		<td><p>{S_BELIEF}</p></td>
	</tr>	
</table>
<!-- ENDIF -->	

		
</div>


<div class="panel" > 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>
		
		{U_QUERY_USERNAME} - {L_SV_PERFORMANCE}   		
		
	</h2> 	
</div>



 
<!-- IF S_PERFORMANCE  -->

	<span style="float:right">	
	<a  href="{BOARD_URL}download.php?mode=user_value&user_id={S_QUERY_USER_ID}"  >
				<img title="{L_SV_USER_VALUE_DOWNLOAD_TIP}" src="{T_IMAGES_PATH}csv_file.png"  width="36" height="36" class='edit_note_icon'/> 
			</a>			
	</span>	
	

	
	
	<!-- INCLUDE user_roi.html -->
	
			
<!-- IF ! S_USE_HTML5_CANVAS -->

<div id="my_chart"></div>

<!-- ELSE -->

<canvas id="user_value_canvas" width="700" height="460"> </canvas>   </td>

<script>        
          
var line = new RGraph.Line('user_value_canvas', [{S_USER_VALUE_HTML5}]);
		//line.set('tooltips', ['{S_USER_VALUE_TOOLTIP_HTML5}']);
		line.set('tooltips', ['1','2']);
        line.set('spline', true);
        line.set('numxticks', 11);
        line.set('numyticks', 5);
        line.set('axis.color', 'blue');
        
        line.set('background.grid.autofit.numvlines', 11);
        line.set('colors', ['blue']);
        line.set('linewidth', 2);
        line.set('gutter.left', 70);
        line.set('gutter.right', 70);
        //line.set('labels',['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']);
        line.set('shadow',true);
        line.set('shadow.color','#aaa');
        line.set('shadow.blur',5);
        line.set('tickmarks',null);
        line.draw();
        
var taiex_line = new RGraph.Line('user_value_canvas', [{S_TAIEX_HTML5}]);
        taiex_line.set('spline', true);
        taiex_line.set('numxticks', 11);
        
        taiex_line.set('yaxispos', 'right');
        taiex_line.set('numyticks', 5);
        taiex_line.set('background.grid.autofit.numvlines', 11);
        taiex_line.set('colors', ['grey']);
        taiex_line.set('linewidth', 1);
        taiex_line.set('gutter.left', 70);
        taiex_line.set('gutter.right', 70);
        //taiex_line.set('labels',['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']);
        taiex_line.set('shadow',true);
        taiex_line.set('shadow.color','#aaa');
        taiex_line.set('shadow.blur',5);
        taiex_line.set('tickmarks',null);
        taiex_line.draw();
        
</script>
<!-- ENDIF -->

	<!-- IF S_SHOW_BRIEF_HISTORY -->
		<!-- INCLUDE brief_history.html -->
	<!-- ENDIF -->	
	
	
	
<!-- ELSE -->
{L_SV_NO_PERFORMANCE}
<!-- ENDIF -->
</div>

<!-- INCLUDE holding_stock_list.html -->

<!-- INCLUDE delegation_list.html -->


<!-- IF S_EQUITY_CHANGE_LIST  -->
<div class="panel" > 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{L_SV_EQUITY_CHANGE_LOG}</h2> 
	</div>
	
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>			
			<td><p>{L_SV_SCHEDULED_DATE}</p></td>
			<td><p>{L_SV_EXECUTION_DATE}</p></td>
			<td><p>{L_SV_CORP_NAME}</p></td>
			<td><p>{L_SV_SHARE_BEFORE_CHANGE}</p></td>
			<td><p>{L_SV_DISPATCHED_CASH}</p></td>
			<td><p>{L_SV_SHARE_AFTER_CHANGE}</p></td>
			
		</tr>
		<!-- BEGIN equity_change_log_list -->
		<tr>
			<td><p>{equity_change_log_list.SCHEDULED_DATE}</p></td>
			<td><p>{equity_change_log_list.EXECUTION_DATE}</p></td>
			<td><p>{equity_change_log_list.CORP_NAME}({equity_change_log_list.CORP_ID})</p></td>
			<td><p>{equity_change_log_list.SHARE}</p></td>
			<td><p>{equity_change_log_list.USER_GET_CASH_AFTER_CHANGE}</p></td>
			<td><p>
				<!-- IF equity_change_log_list.CORP_ID == equity_change_log_list.USER_GET_CORP_ID_AFTER_CHANGE  -->
				{equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE}
				<!-- ELSE -->
				{equity_change_log_list.CORP_NAME_AFTER_CHANGE}({equity_change_log_list.USER_GET_CORP_ID_AFTER_CHANGE}) {equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE} {L_SV_SHARE}
				<!-- ENDIF -->
				<!-- IF equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE_2 != 0  -->
				, {L_SV_DISPATCH_IN_ADDITION} {equity_change_log_list.CORP_NAME_AFTER_CHANGE_2}({equity_change_log_list.USER_GET_CORP_ID_AFTER_CHANGE_2}) {equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE_2} {L_SV_SHARE}
				<!-- ENDIF -->
				<!-- IF equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE_3 != 0  -->
				,  {equity_change_log_list.CORP_NAME_AFTER_CHANGE_3}({equity_change_log_list.USER_GET_CORP_ID_AFTER_CHANGE_3}) {equity_change_log_list.USER_GET_SHARE_AFTER_CHANGE_3} {L_SV_SHARE}
				<!-- ENDIF -->
			</p></td>
			
		</tr>
		<!-- END equity_change_log_list -->
	</table>
			
</div>
<!-- ENDIF -->

<!-- INCLUDE sv_overall_footer.html -->